import java.util.Scanner;

public class PingFen {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int arr[]=new int[7];
        for (int i=0;i< arr.length;i++){
            System.out.println("请第"+(i+1)+"位裁判打分" );
            arr[i]=sc.nextInt();
        }
        int sum=0;
        int max=arr[0];
        int min=arr[0];
        for (int i=0;i< arr.length;i++){
            if (arr[i]>max){
                max=arr[i];
            }
            if (arr[i]<min){
                min=arr[i];
            }
            sum+=arr[i];
            }
        System.out.println("平均分为"+(sum-max-min)/5);
        }
    }

